Load Data

Table Joins

team_log_w_manager <- join_manager_table(team_logs, manager_table)
# need to normalize moves
full_table <- join_standings_table(team_log_w_manager, standings_table) %>%
    normalize_cols()

totals_table <- full_table %>%
    dplyr::filter(
        Name == "Total",
        Manager != "Collin",
        Manager != "Noel"
    ) %>%
    dplyr::mutate(
        Manager = as.factor(Manager),
        division = as.factor(division)
    ) %>%
    dplyr::select(
        -c(
            "W-L-T",
            "Div",
            "team_name",
            "GWG",
            "SOG",
            "Name",
            "division",
            "Pct",
            "Pts",
            "Waiver",
            "pre_playoff_rank"
        )
    )

Games Played

## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors

## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors

Corplot

Drop high correlation features

Test for Near Zero Variance

##                 freqRatio percentUnique zeroVar   nzv
## final_rank       1.000000     26.086957   FALSE FALSE
## Manager.Dan     10.500000      4.347826   FALSE FALSE
## Manager.Mitch   10.500000      4.347826   FALSE FALSE
## assist_norm      2.000000     86.956522   FALSE FALSE
## pim_norm         2.000000     89.130435   FALSE FALSE
## plus_minus_norm  1.333333     84.782609   FALSE FALSE

Split into test/train split

build skim tables

## [1] 36
## [1] 10

Train Model and recursively remove value of least significance.

## 
## Call:
## NULL
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -3.5079  -1.7594  -0.6212   1.7181   5.2889  
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)    
## (Intercept)       26.536      4.139   6.411 4.45e-07 ***
## Manager.Dan       -3.976      1.399  -2.841  0.00800 ** 
## Manager.Mitch     -4.567      1.781  -2.564  0.01558 *  
## assist_norm      -12.591      4.540  -2.773  0.00945 ** 
## pim_norm          -8.719      2.825  -3.087  0.00433 ** 
## plus_minus_norm   -3.875      1.547  -2.505  0.01791 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for gaussian family taken to be 5.177509)
## 
##     Null deviance: 410.56  on 35  degrees of freedom
## Residual deviance: 155.33  on 30  degrees of freedom
## AIC: 168.8
## 
## Number of Fisher Scoring iterations: 2
##  [1]  2  1  9  6  9  3  7 11 12  5
## [1] "RMSE: 3.04955783452832"